﻿using System.Windows.Forms;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using iBeauty.App.Common;
using iBeauty.App.UCControl;


namespace iBeauty.App
{
    public partial class FrmMain : RibbonForm
    {
        public FrmMain()
        {
            InitializeComponent();
        }

        #region Private methods

        public void ActiveUserControl(UserControl userControl)
        {
            userControl.Dock = DockStyle.Fill;

            splitContainerControl.Panel2.Controls.Clear();

            splitContainerControl.Panel2.Controls.Add(userControl);
            userControl.Show();
           
        }

        #endregion

        #region Event handle

        private void FrmMain_Load(object sender, System.EventArgs e)
        {
            BeautyControls.Init(this);
        }

        private void BtnCustomerItemClick(object sender, ItemClickEventArgs e)
        {
            ActiveUserControl(BeautyControls.CustomerUc);
        }

        private void BtnStaffItemClick(object sender, ItemClickEventArgs e)
        {
            ActiveUserControl(new StaffUc());
        }

        private void BtnProductItemClick(object sender, ItemClickEventArgs e)
        {
            ActiveUserControl(new ProductUc());
        }

        private void BtnServiceItemClick(object sender, ItemClickEventArgs e)
        {
            ActiveUserControl(new ServiceUc());
        }

        private void btnPreference_ItemClick(object sender, ItemClickEventArgs e)
        {
            ActiveUserControl(new PreferenceUc());
        }

        #endregion

    }
}